package com.cskaoyan.catmall.controller.background;

import com.cskaoyan.catmall.annotation.OperationLog;
import com.cskaoyan.catmall.model.vo.BaseRespVo;
import com.cskaoyan.catmall.model.vo.RegionListVo;
import com.cskaoyan.catmall.service.RegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 创建日期: 2022-01-07-08-21
 * author : WQW
 * description: 行政区域相关接口
 */

@RestController
@RequestMapping("admin/region")
public class RegionController {


    @Autowired
    RegionService regionService;

    /**
     * @param
     * @return com.cskaoyan.catmall.model.vo.BaseRespVo<com.cskaoyan.catmall.model.vo.RegionListVo>
     * @description 获取行政区域信息
     * @author WQW
     * @date 2022/1/7 8:46
     */
    @OperationLog("查询行政区域")
    @GetMapping("list")
    public BaseRespVo<RegionListVo> list() {
        // 调用service层方法行政区域列表
        RegionListVo regionList = regionService.getRegionList();
        return BaseRespVo.ok(regionList);
    }

}
